import utils from "../utils";

const STORAGE_STR = 'PHQ_SYSTEM_STORAGE_UIAUTH';

export default class UiAuth {
    public Get(): any {
        const val = sessionStorage.getItem(STORAGE_STR) as string;
        return utils.empty(val) ? {} : JSON.parse(val);
    }
    public Set(val: any) {
        if (!utils.empty(val)) {
            sessionStorage.setItem(STORAGE_STR, JSON.stringify(val));
        }
    }
    public Remove() {
        sessionStorage.removeItem(STORAGE_STR);
    }
}